<?php if (!defined('BASEPATH')) exit('No direct script access allowed');

/**
 * Extend functions of @see CI_URI
 * @author KhoiNM
 *
 */
class MY_URI extends CI_URI {
	/**
	 * Get fully url address
	 * @return string - full url address
	 */
	function full_url_address(){
		if (isset($_SERVER['HTTPS'])){
			$url = $_SERVER['HTTPS'] == 'on' ? 'https' : 'http';
		}else{
			$url = 'http';
		}
		return $url .'://'.$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'];
	}

	function full_uri_address(){
		return $_SERVER['REQUEST_URI'];
	}

	/**
	 * Get Url Referer
	 * @return unknown_type
	 */
	function url_referer(){
		return isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : '';
	}
}

?>